	{{template "header_en"}}
		<title>Go Walker - Go API documentation and project view</title>
	</head>

	<body id="body">
		{{template "navbar_en" .}}
		<div class="container">
			<div>
				{{template "alert_en" .}}
                <div class="page-header">
                    <h2>
                        Search Go projects.
                        <small>Find a cup of source code.</small>
                        <g:plusone></g:plusone>
                    </h2>

               		<form class="form-inline" action="/">
                		<div class="form-group col-md-6">
                        	<input autocomplete="off" class="form-control" type="text" placeholder="Type import path to add and view or use keywords to search" name="q" data-source="[{{str2html .GoReposSrc}}]" data-items="10" data-provide="typeahead">
                        </div>
                        <button class="btn btn-success btn-lg" style="border-radius: 0px;" type="submit"><i class="icon-search"></i> I'm feeling lucky</button>
                	</form>
                </div>
			</div>

			<div class="row">
				<div class="col-md-8">
					<div>
						<h4>What is this?</h4>
						<p>
							Go Walker Server generates <a target="_blank" href="http://golang.org/">Go</a> projects API documentation and
							<button class="btn feature" title=""
							        data-content="Hacker view allows you study a Go project without any installation, and with awesome features like 'jump to definition' and 'find usage'."
							        data-placement="top" data-toggle="popover" data-original-title="Hacker View">Hacker View</button>
							on the fly for the projects on <b><a target="_blank" href="https://bitbucket.org/">Bitbucket</a></b>, <b><a target="_blank" href="https://github.com/">GitHub</a></b>, <b><a target="_blank" href="http://code.google.com/">Google Code</a></b>, <b><a target="_blank" href="https://launchpad.net/">Launchpad</a></b>, <b><a target="_blank" href="https://gitcafe.com/">GitCafe</a></b>  and <b><a target="_blank" href="http://git.oschina.net/">Git @ OSC</a></b>.
						</p>

						<p>
							Awesome features
                            <button class="btn feature" title=""
                                    data-content="View function and method code with nice highlight in the same page, reduce rake up space and do more work at the same time."
                                    data-placement="bottom" data-toggle="popover" data-original-title="Code View">Code View</button>

                            <button class="btn feature" title=""
                                    data-content="Quick jump to functions, methods and types from imported packages, reduce time to find."
                                    data-placement="top" data-toggle="popover" data-original-title="Link Jump">Link Jump</button>

                            <button class="btn feature" title=""
                                    data-content="Add examples for your favorite projects through Github Gist." data-placement="bottom"
                                    data-toggle="popover" data-original-title="Add Example">Add Example</button>

                            <button class="btn feature" title=""
                                    data-content="Don't worry if you use old version of a project, now you can view documentation by its Tags!"
                                    data-placement="right" data-toggle="popover" data-original-title="View by Tag">Doc Tag</button>

                            and <a target="_blank" href="https://github.com/Unknwon/gowalker/blob/master/docs/Features.md">More</a>.
						</p>

                        <p class="text-success">
                            Please read the <a href="/about">About Page</a> for information about hacking with Go Walker and more.
                        </p>
					</div>

					<div class="tab-content">
					    <div id="global_history" class="tab-pane fade active in">
					        <h4>
					            What all the people are looking at.
					            <a href="#user_history" class="btn btn-inverse" data-toggle="tab">Local history</a>
					            <small class="text-info">Hover link to see more.</small>
					        </h4>

					        <table name="recent_table" class="table table-bordered table-hover">
					            <thead>
					                <tr>
					                    <th>Import Path</th>
					                    <th>Viewd Time(Local)</th>
					                </tr>
					            </thead>

					            <tbody>
						            {{range .GlobalHistory}}
						            {{template "history_table" .}}
						            {{end}}
					            </tbody>
					        </table>
					    </div>

					    <div id="user_history" class="tab-pane fade">
					        <h4>
					            What you have been looking at.
					            <a href="#global_history" class="btn btn-inverse" data-toggle="tab">Global history</a>
					            <small class="text-info">Hover link to see more.</small>
					        </h4>

					        <table name="recent_table" class="table table-bordered table-hover">
					            <thead>
					                <tr>
					                    <th>Import Path</th>
					                    <th>Viewd Time(Local)</th>
					                </tr>
					            </thead>

					            <tbody>
						            {{range .UserHistory}}
						            {{template "history_table" .}}
						            {{end}}
					            </tbody>
					        </table>
					    </div>
					</div>
				</div>

				<div class="col-md-4" style="padding-left: 5px;">
					<div>
						<h4>Announcement</h4>
						<p>
							Are you still downloading and installing Go projects but just for looking up some functions and methods? I know it's hard to do untile you found <b>Hacker View</b> today!
						</p>
						<a class="btn btn-primary" target="_blank" href="https://github.com/Unknwon/gowalker/wiki/Features">Learn more</a>
					</div>

					<div>
						<h4>Popular Projects</h4>
                        <ul class="nav nav-tabs nav-tabs-google">
                            <li class="active">
                                <a href="#weekly_stars" data-toggle="tab">Weekly Stars</a>
                            </li>

                            <li>
                                <a href="#top_rank" data-toggle="tab">Top Rank</a>
                            </li>

                            <li>
                                <a href="#top_views" data-toggle="tab">Top Views</a>
                            </li>
                        </ul>

                        <div class="tab-content" style="padding-top: 10px;">
                            <div id="weekly_stars" class="tab-pane fade active in">
                                <ul name="pop_list" class="unstyled">
                                    {{range .WeeklyStarPros}}
                                    <li>
                                        <span class="badge badge-success">{{.Rank}}</span>
                                        <a title="{{.Synopsis}}" href="/{{.Path}}">{{.Path}}</a>
                                    </li>
                                    {{end}}
                                </ul>
                            </div>

                            <div id="top_rank" class="tab-pane fade">
                                <ul name="pop_list" class="unstyled">
                                    {{range .TopRankPros}}
                                    <li>
                                        <span class="badge badge-inverse">{{.Rank}}</span>
                                        <a title="{{.Synopsis}}" href="/{{.Path}}">{{.Path}}</a>
                                    </li>
                                    {{end}}
                                </ul>
                            </div>

                            <div id="top_views" class="tab-pane fade">
                                <ul name="pop_list" class="unstyled">
                                    {{range .TopViewsPros}}
                                    <li>
                                        <span class="badge">{{.Views}}</span>
                                        <a title="{{.Synopsis}}" href="/{{.Path}}">{{.Path}}</a>
                                    </li>
                                    {{end}}
                                </ul>
                            </div>
                        </div>
					</div>

					<div>
						<h4>Recent Updated Examples</h4>
                        <ul name="pop_list" class="unstyled">
                            {{range .RecentExams}}
                            <li>
                                <a href="/{{.Path}}">{{.Path}}</a>
                            </li>
                            {{end}}
                        </ul>
					</div>

				    {{template "home_js"}}
					
					<div>
						<h4>Explore more.</h4>
                        <ul class="nav nav-tabs nav-tabs-google">
                            <li class="active">
                                <a href="#more_projects" data-toggle="tab">Projects</a>
                            </li>

                            <li>
                                <a href="#more_sites" data-toggle="tab">Sites</a>
                            </li>
                        </ul>

                        <div class="tab-content" style="padding-top: 10px;">
                            <div id="more_projects" class="tab-pane fade active in">
                                <ul class="unstyled">
                                    <li>
                                    	<a href="/index">Index</a>
                                    	- everything involved
                                    </li>

                                    <li>
                                    	<a href="/index/gorepos">Go Standard Library</a>
                                    </li>

                                    <li>
                                    	<a href="/index/gosubrepos">Go Sub-repositories</a>
                                    	- Developed by Go team
                                    </li>

                                    <li>
                                    	<a target="_blank" href="https://code.google.com/p/go-wiki/wiki/Projects">Projects @ go-wiki</a>
                                    </li>

                                    <li>
                                    	<a target="_blank" href="http://go-search.org">Go Search</a>
                                    	- even more stuff
                                    </li>
                                </ul>
                            </div>

                            <div id="more_sites" class="tab-pane fade">
                                <ul class="unstyled">
                                    <li>
                                    	<a target="_blank" href="http://bbs.beego.me">Beego Community</a>
                                    </li>

                                    <li>
                                    	<a target="_blank" href="https://gobyexample.com/">Go by Example</a>
                                    </li>

                                    <li>
                                    	<a target="_blank" href="http://golangtc.com">Golang 中国</a>
                                    	－ Go 语言交流学习论坛
                                    </li>

                                    <li>
                                    	<a target="_blank" href="http://sudochina.com">速动中国</a>
                                    	- Go 语言技术分享博客站
                                    </li>
                                </ul>
                            </div>
                        </div>
					</div>
				</div>
			</div>
		</div>
        {{template "footer_en" .}}
	</body>
</html>

{{define "history_table"}}
<tr>
    <td>
        <a title="{{.Synopsis}}" href="/{{.Path}}">{{.Path}}</a>

        {{if .IsGoRepo}}
        <span class="label label-info">Standard</span>
        {{end}}
    </td>

    <td>{{.ViewedTime}}</td>
</tr>
{{end}}

{{define "home_js"}}
		<link href="/static/css/todc-bootstrap.css" rel="stylesheet" />
<script>
    (function () {
        var tables = document.getElementsByName("recent_table");
        var now = new Date();
        for (var n = 0; n < tables.length; n++) {
            var table = tables[n];
            var items = table.getElementsByTagName("tr");
            for (var i = 1; i < items.length; i++) {
                // Limit length.
                var s = table.rows[i].cells[0].getElementsByTagName("a")[0];
                if (s.innerHTML.length > 45) {
                    s.innerHTML = "..." + s.innerHTML.substr(s.innerHTML.length - 42);
                }
                // Convert timestamp to local time.
                var t = parseInt(table.rows[i].cells[1].innerHTML);
                var d = new Date(t * 1000);
                table.rows[i].cells[1].innerHTML = d.toLocaleString();
            }
        }
    })();

    (function () {
        var lists = document.getElementsByName("pop_list");
        var now = new Date();
        for (var n = 0; n < lists.length; n++) {
            var list = lists[n];
            var items = list.getElementsByTagName("li");
            for (var i = 0; i < items.length; i++) {
                // Limit length.
                var s = items[i].getElementsByTagName("a")[0];
                if (s.innerHTML.length > 40) {
                    s.title="Path: "+ s.innerHTML+"\n"+ s.title;
                    s.innerHTML = "..." + s.innerHTML.substr(s.innerHTML.length - 37);
                }
            }
        }
    })();
</script>
{{end}}